

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>Node &mdash; BartPy 0.0.1 documentation</title>
  

  
  
  
  

  

  
  
    

  

  
    <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Split" href="split.html" />
    <link rel="prev" title="Welcome to BartPy’s documentation!" href="index.html" /> 

  
  <script src="_static/js/modernizr.min.js"></script>

</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search">
          

          
            <a href="index.html" class="icon icon-home"> BartPy
          

          
          </a>

          
            
            
              <div class="version">
                0.0.1
              </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <p class="caption"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">Node</a></li>
<li class="toctree-l1"><a class="reference internal" href="split.html">Split</a></li>
<li class="toctree-l1"><a class="reference internal" href="tree.html">Tree</a></li>
<li class="toctree-l1"><a class="reference internal" href="model.html">Model</a></li>
<li class="toctree-l1"><a class="reference internal" href="sampling.html">Samplers</a></li>
</ul>

            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="index.html">BartPy</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="index.html">Docs</a> &raquo;</li>
        
      <li>Node</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="_sources/node.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="node">
<h1>Node<a class="headerlink" href="#node" title="Permalink to this headline">¶</a></h1>
<dl class="docutils">
<dt>In BartPy, Trees are made up of two types of Nodes:</dt>
<dd><ol class="first last arabic simple">
<li>DecisionNodes - representing binary splits of feature space</li>
<li>LeafNodes - representing the final grouping of points together</li>
</ol>
</dd>
</dl>
<p>Each Node maps to a <cite>Split</cite> class which contains all of the information about how a <cite>Node</cite> relates to data</p>
<span class="target" id="module-bartpy.node"></span><dl class="class">
<dt id="bartpy.node.DecisionNode">
<em class="property">class </em><code class="descclassname">bartpy.node.</code><code class="descname">DecisionNode</code><span class="sig-paren">(</span><em>split: bartpy.split.Split, left_child_node: typing.Union[bartpy.node.LeafNode, _ForwardRef('DecisionNode')], right_child_node: typing.Union[bartpy.node.LeafNode, _ForwardRef('DecisionNode')], depth=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/bartpy/node.html#DecisionNode"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#bartpy.node.DecisionNode" title="Permalink to this definition">¶</a></dt>
<dd><p>A <cite>DecisionNode</cite> encapsulates internal node in the tree
Unlike a <cite>LeafNode</cite>, it contains very little actual logic beyond tying the tree together</p>
</dd></dl>

<dl class="class">
<dt id="bartpy.node.LeafNode">
<em class="property">class </em><code class="descclassname">bartpy.node.</code><code class="descname">LeafNode</code><span class="sig-paren">(</span><em>split: bartpy.split.Split</em>, <em>depth=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/bartpy/node.html#LeafNode"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#bartpy.node.LeafNode" title="Permalink to this definition">¶</a></dt>
<dd><p>A representation of a leaf node in the tree
In addition to the normal work of a <cite>Node</cite>, a <cite>LeafNode</cite> is responsible for:</p>
<blockquote>
<div><ul class="simple">
<li>Interacting with <cite>Data</cite></li>
<li>Making predictions</li>
</ul>
</div></blockquote>
</dd></dl>

<dl class="class">
<dt id="bartpy.node.TreeNode">
<em class="property">class </em><code class="descclassname">bartpy.node.</code><code class="descname">TreeNode</code><span class="sig-paren">(</span><em>split: bartpy.split.Split</em>, <em>depth: int</em>, <em>left_child: typing.Union[bartpy.node.TreeNode</em>, <em>NoneType] = None</em>, <em>right_child: typing.Union[bartpy.node.TreeNode</em>, <em>NoneType] = None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/bartpy/node.html#TreeNode"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#bartpy.node.TreeNode" title="Permalink to this definition">¶</a></dt>
<dd><p>A representation of a node in the Tree
Contains two main types of information:</p>
<blockquote>
<div><ul class="simple">
<li>Data relevant for the node</li>
<li>Links to children nodes</li>
</ul>
</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="bartpy.node.split_node">
<code class="descclassname">bartpy.node.</code><code class="descname">split_node</code><span class="sig-paren">(</span><em>node: bartpy.node.LeafNode</em>, <em>split_condition: bartpy.split.SplitCondition</em><span class="sig-paren">)</span> &#x2192; bartpy.node.DecisionNode<a class="reference internal" href="_modules/bartpy/node.html#split_node"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#bartpy.node.split_node" title="Permalink to this definition">¶</a></dt>
<dd><p>Converts a <cite>LeafNode</cite> into an internal <cite>DecisionNode</cite> by applying the split condition
The left node contains all values for the splitting variable less than the splitting value</p>
</dd></dl>

</div>


           </div>
           
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="split.html" class="btn btn-neutral float-right" title="Split" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="index.html" class="btn btn-neutral" title="Welcome to BartPy’s documentation!" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright 2018, Jake Coltman.

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  


  

    <script type="text/javascript">
        var DOCUMENTATION_OPTIONS = {
            URL_ROOT:'./',
            VERSION:'0.0.1',
            LANGUAGE:'None',
            COLLAPSE_INDEX:false,
            FILE_SUFFIX:'.html',
            HAS_SOURCE:  true,
            SOURCELINK_SUFFIX: '.txt'
        };
    </script>
      <script type="text/javascript" src="_static/jquery.js"></script>
      <script type="text/javascript" src="_static/underscore.js"></script>
      <script type="text/javascript" src="_static/doctools.js"></script>
      <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

  

  
  
    <script type="text/javascript" src="_static/js/theme.js"></script>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>